package com.sjh.tomcat;

import com.sjh.tomcat.handler.SjhRequestHandler;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class SjhTomcatV2 {

    public static void main(String[] args) throws IOException {

        ServerSocket serverSocket = new ServerSocket(8080);
        System.out.println("=======客户端正在8080端口监听=======");
        while(!serverSocket.isClosed()){
            Socket socket = serverSocket.accept();
            SjhRequestHandler sjhRequestHandler = new SjhRequestHandler(socket);
            new Thread(sjhRequestHandler).start();
        }
        serverSocket.close();
    }
}
